# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AdSensePlatform.V1alpha.Model.Address do
  @moduledoc """
  Address data.

  ## Attributes

  *   `address1` (*type:* `String.t`, *default:* `nil`) - First line of address. Max length 64 bytes or 30 characters.
  *   `address2` (*type:* `String.t`, *default:* `nil`) - Second line of address. Max length 64 bytes or 30 characters.
  *   `city` (*type:* `String.t`, *default:* `nil`) - City. Max length 60 bytes or 30 characters.
  *   `company` (*type:* `String.t`, *default:* `nil`) - Name of the company. Max length 255 bytes or 34 characters.
  *   `contact` (*type:* `String.t`, *default:* `nil`) - Contact name of the company. Max length 128 bytes or 34 characters.
  *   `fax` (*type:* `String.t`, *default:* `nil`) - Fax number with international code (i.e. +441234567890).
  *   `phone` (*type:* `String.t`, *default:* `nil`) - Phone number with international code (i.e. +441234567890).
  *   `regionCode` (*type:* `String.t`, *default:* `nil`) - Country/Region code. The region is specified as a CLDR region code (e.g. "US", "FR").
  *   `state` (*type:* `String.t`, *default:* `nil`) - State. Max length 60 bytes or 30 characters.
  *   `zip` (*type:* `String.t`, *default:* `nil`) - Zip/post code. Max length 10 bytes or 10 characters.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :address1 => String.t() | nil,
          :address2 => String.t() | nil,
          :city => String.t() | nil,
          :company => String.t() | nil,
          :contact => String.t() | nil,
          :fax => String.t() | nil,
          :phone => String.t() | nil,
          :regionCode => String.t() | nil,
          :state => String.t() | nil,
          :zip => String.t() | nil
        }

  field(:address1)
  field(:address2)
  field(:city)
  field(:company)
  field(:contact)
  field(:fax)
  field(:phone)
  field(:regionCode)
  field(:state)
  field(:zip)
end

defimpl Poison.Decoder, for: GoogleApi.AdSensePlatform.V1alpha.Model.Address do
  def decode(value, options) do
    GoogleApi.AdSensePlatform.V1alpha.Model.Address.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AdSensePlatform.V1alpha.Model.Address do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
